package BufferedReaderTest;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-10-01
 * Time: 20:23
 */
public class demo1 {
    public static void main(String[] args) throws IOException {
        try(BufferedReader bufferedReader = new BufferedReader(new FileReader("e://demo.txt"))){
            //一行一行的读取
            //读取到文件结尾返回null
            while(true){
                String line = bufferedReader.readLine();
                if(line==null){
                    break;
                }
                System.out.println(line);
            }
        }
    }

}
